package com.lhc.nacosconsumer.controller;

import com.lhc.nacosconsumer.mapper.StockMapper;
import com.lhc.nacosconsumer.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuchaoqun
 * @date 2022/6/18
 * @Description 库存
 */
@RestController
@RequestMapping("/stock")
public class StockController {


    @Autowired
    StockService stockService;

    @GetMapping("/{id}")
    public String reduce(@PathVariable("id") Long id) {
        stockService.reduce(id);
        return "扣减库存成功";
    }
}
